<!-- 提现记录 -->
<template>
	<view class="page">
		<status-bar title='提现记录'></status-bar>
		<view class="wdw_list">
			<view class="wdw_item" v-for="(item,index) in deposit" :key="index" v-if='item.bankCard'>
				<view class="wdw_bank_money">
					<view class="f_032">{{item.bankName}}(尾号{{item.bankCard}})</view>
					<view class="f_028 c_ff4b4e">￥{{item.money}}</view>
				</view>
				<view class="wdw_state">
					<view class="c_999999" v-if="item.state == 1">正在处理...</view>
					<view class="success-color" v-if="item.state == 2">提现成功<br />{{item.handleTime}}</view>
					<view class="error-color" v-if="item.state == 0">提现失败<br />{{item.handleTime}}</view>
				</view>
				<view class="wdw_time">
					<view>发起时间</view>
					<view>{{item.createTime}}</view>
				</view>
			</view>
		</view>
		<empty v-if='noData' type='1' cat='3' :msg='errMsg'></empty>
	</view>
</template>

<script>
	var that;
	export default{
		data(){
			return{
				deposit:[],
				noData:false,
				errMsg:'还没有相关提现记录哦 ~'
			}
		},
		onShareAppMessage(option) {			
			let shareData = uni.getStorageSync('shareData');
			let vid = uni.getStorageSync('vid');
			return {
				title: shareData.title,
				desc: shareData.desc,
				path: '/pages/index/index?share_v_id=' + vid+'&pageType=99',
				imageUrl: shareData.imageUrl
			}		},
		onLoad() {
			that = this;
			that.getDeposit()
			
		},
		methods:{
			getDeposit:function(){
				that.$http.post({
					url: '/singleSaleApi/withdrawalSubsidiary',
					data: {
						v_id: uni.getStorageSync("vid")
					}
				}).then(res => {
					if(res.status){
						that.deposit = res.data;
						if(that.deposit){
							that.deposit.forEach((item,index)=>{
								if(item.bankCard)
									that.deposit[index].bankCard = item.bankCard.substring(item.bankCard.length - 4,item.bankCard.length)
							})
						}
						if(!that.deposit || that.deposit.length < 1)
							that.noData = true
					} else {
						that.errMsg = res.msg
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.page{
		.wdw_item{
			height: 280upx;
			border-radius: 10px;
			margin-bottom: 30upx;
			padding: 30upx;
			background: #ffffff;
			box-sizing: border-box;
			-webkit-box-sizing: border-box;
			position: relative;
			.wdw_bank_money{
				display: flex;
				display: -webkit-flex;
				justify-content: space-between;
			}
			.wdw_state{
				width: 100%;
				height: 100%;
				display: flex;
				display: -webkit-flex;
				justify-content: center;
				align-items: center;
				font-size: 28rpx;
				text-align: center;
				position: absolute;
				top: 0;
				left: 0;
				z-index: 1;
				view{
					font-size: 30rpx;
				}
			}
			.wdw_time{
				display: flex;
				display: -webkit-flex;
				justify-content: space-between;
				font-size: 28upx;
				font-family: arial;
				color: #999999;
				position: absolute;
				right: 30upx;
				bottom: 30upx;
				left: 30upx;
				z-index: 1;
			}
		}
	}
	.empty{color: red;}
</style>
